Fedora6MinimalChroot
Category:Distributions Category:Fedora I started this page because I wanted a different way of installing Fedora Core on colinux instead of Qemu. The best way is using bootCD. So I tried that first. At the moment it does not work with bootcd. It askes for driver when starting. Another way is using anaconda directly. With that option I am further. It start with DVD but at the moment it does not recognize the harddisk. Another way is using chroot. That's the way I will show here. In this case it installs on an empty partition a new installation of fedora. After that you can use the installed partition as a new bootdevice (You need host linux os with smart). I am using working fedora :) If you can improve please do.'' If you have questions ask at techdesk100 (at) hotmail (dot) com. Extra information This page is for intermediate colinux users. Beginners can better use this page Link TOOLS * explore2fs To be able to copy your files from image in Windows. One way. * unxutils like dd ls * winpcap driver for winpcap WEBSITES * colinux official site * colinux wiki * development and stable binaries website of henry nestler * colinux mailing list to search for known problems PREPARATION OK I am starting with the following setup /dev/hda1 host linux os /dev/hda2 linux partition where we will install a clean Fedora Core 6 installation /dev/hda3 Fedora Core 6 DVD /dev/hdb 512mb swap file * Create an extra image 1gb (1024*1024*1024*1) file by using the following command in the dosprompt (windows XP): fsutil file createnew c:\Linux\Distro\ext3_disk_1gb.img 1073741824 * Here is an example colinux.conf file: ############################################ # MAKE SURE THERE IS AN EXTRA LINE AT THE END # OF THE BATCH FILE # # initrd should only be used at first start # to install kernel modules for example when # you upgrade your colinux ############################################ ############################################ # DEFAULT ############################################ # set your runlevel to text-only mode or graphical mode # root=/dev/hda1 fastboot 1 (single-user mode) # root=/dev/hda1 fastboot 3 (text-only mode) # root=/dev/hda1 fastboot 5 (graphic mode) ############################################ kernel=vmlinux initrd=initrd.gz mem=256 root=/dev/hda1 fastboot 5 ############################################ # Drives ############################################ #cobd0=C:\Linux\Distro\image #hda1=:cobd0 ############################################ hda1=\DosDevices\C:\Linux\Distro\host.img hda2=\DosDevices\C:\Linux\Distro\ext3_disk_1gb.img hda3=\DosDevices\C:\Linux\Distro\DIST_FC6-i386-DVD.iso hdb1=\DosDevices\C:\Linux\Distro\swap_512mb ############################################ # Ethernet ############################################ #eth0=slirp,00:ff:00:00:00:00 #eth0=pcap-bridge,"LAN", 00:ff:00:00:00:00 #eth0=tuntap,TAP,00:ff:00:00:00:00 ############################################ eth0=tuntap,"TAP",00:ff:00:00:00:00 # please leave this as last line. Otherwise last of macadress goes as input for boot * startup colinux * format image to ext3 mkfs -t ext3 /dev/hda2 * mount drives mount /dev/hda2 /mnt/disk mount /dev/hda3 /mnt/cdrom * create some directories which we need to send stuff from host os mkdir /mnt/disk/dev /mnt/disk/proc/ /mnt/disk/sys mount --bind /dev /mnt/disk/dev mount --bind /proc /mnt/disk/proc mount --bind /sys /mnt/disk/sys Fedora minimal install INSTALL FROM INTERNET USING SMART * install smart (fedora core installs also fedora-package-config-smart) yum install smart * update channels. Fedora directly shows channels smart update * I choose 'Fedora Core 6 - i386 (core)' 'Fedora Core 6 - i386 - Updates (updates)' 'Fedora Core 6 - i386 (extras)' 'Fedora Core 6 - Development (development)' * update again Will get metadata xml files smart update * For minimal install we need to know which rpms we need (groupinfo is not available in smart so we need to do it from yum) BASE_RPMS=` yum groupinfo Base | sed -n '/Mandatory Packages/,/Optional Packages/p' | sed -e '/Mandatory Packages/d' -e '/Default Packages/d' -e '/Optional Packages/d' | tr -d '\n' * Now you know which rpms to install so install it to disk smart -o rpm-root=/mnt/disk install $BASE_RPMS INSTALL FROM DVD USING SMART * install smart (fedora core installs also fedora-package-config-smart) yum install smart * update channels smart update * remove channels smart channel --remove-all * add dvd as repository smart channel --add dvd type=rpm-md baseurl=file:///mnt/cdrom * update. Will get metadata xml file smart update * For minimal install we need to know which rpms we need (groupinfo is not available in smart so we need to do it from yum) BASE_RPMS=` yum groupinfo Base | sed -n '/Mandatory Packages/,/Optional Packages/p' | sed -e '/Mandatory Packages/d' -e '/Default Packages/d' -e '/Optional Packages/d' | tr -d '\n' * Now you know which rpms to install so install it to disk smart -o rpm-root=/mnt/disk install $BASE_RPMS INSTALL FROM INTERNET USING YUM * Just one commando. Slower than smart yum --installroot=/mnt/disk groupinstall Base INSTALL FROM DVD USING YUM The problem with yum and DVD is that yum needs a repo. For this you have to create one, and it should be at the same dir as the RPMS. The DVD is a readonly file. You can copy all RPMS to a local dir and create there a repo, or you can do the following workaround. First create repo of RPMS and put that in local dir. Make the local dir the baseurl. Load metadata from baseurl in yum. Change baseurl to RPMS location. Install what you need, but make sure yum does not load metadata again. * For minimal install we need to know which rpms we need (groupinfo is not available in yum local) BASE_RPMS=` yum groupinfo Base | sed -n '/Mandatory Packages/,/Optional Packages/p' | sed -e '/Mandatory Packages/d' -e '/Default Packages/d' -e '/Optional Packages/d' | tr -d '\n' * create file /etc/yum.repos.d/fedora-local.repo touch /etc/yum.repos.d/fedora-local.repo * edit '/etc/yum.repos.d/fedora-local.repo' localrepo name=Fedora Core 6 - My Local Repo baseurl=file:///Repo enabled=1 gpgcheck=0 #gpgkey=file:///path/to/you/RPM-GPG-KEY * create directory /Repo on host mkdir /Repo * install createrepo yum install createrepo * create repo from RPMS dir createrepo -o /Repo /mnt/cdrom/Fedora/RPMS * clean the metadata yum --disablerepo=core,extras,updates clean metadata * update the metadata yum --disablerepo=core,extras,updates update metadata * edit '/etc/yum.repos.d/fedora-local.repo' and change baseurl before localrepo name=Fedora Core 6 - My Local Repo baseurl=file:///Repo enabled=1 gpgcheck=0 #gpgkey=file:///path/to/you/RPM-GPG-KEY after localrepo name=Fedora Core 6 - My Local Repo baseurl=file:///mnt/cdrom/Fedora/RPMS/ enabled=1 gpgcheck=0 #gpgkey=file:///path/to/you/RPM-GPG-KEY * install rpms to disk yum --installroot=/mnt/disk --disablerepo=core,extras,updates install $BASE_RPMS FINALIZING * log into new fedora core installation chroot /mnt/disk * create new /etc/fstab: # example file change to you own needs /dev/hda1 / ext3 defaults 1 1 /dev/hda2 /mnt/disk ext3 defaults 1 1 devpts /dev/pts devpts gid=5,mod=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 /dev/hdb1 swap swap defaults 0 0 * create file for ethernetcard settings touch /etc/sysconfig/network-scripts/ifcfg-eth0 * edit '/etc/sysconfig/network-scripts/ifcfg-eth0' # example file change to you own needs # File: /etc/sysconfig/network-script/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=10.0.0.100 NETMASK=255.255.255.0 GATEWAY=10.0.0.10 #HWADDR=00:ff:00:00:00:00 * password for root is default empty. If you want to create one you get an error 'passwd: Authentication token manipulation error' * edit '/etc/passwd' and change line with root so it wil say that you have a password before root:*:0:0:root:/root:/bin/bash after root:!:0:0:root:/root:/bin/bash * create password for root passwd root * exit chroot * unmount umount /mnt/disk/dev umount /mnt/disk/proc umount /mnt/disk/sys Other steps Continue here